<?php
header ( "Content-type: text/html; charset=utf-8" ); 
	session_start();
	include "../conn/conn.php";
	$sql = "select * from tb_video where name = '".$_POST['name']."'";
	$result=mysqli_query($link,$sql);
	if(mysqli_num_rows($result)>0){
	  echo "<script>alert('商品名重复，请重新输入');history.go(-1);</script>";
		}
     else{
		 
		 $sql_in= "insert into tb_video(name,director,marker,type,remark,intro,picture) values ('".$_POST['name']."','".$_POST['director']."','".$_POST['remark']."','".$_POST['intro']."','".$picture_path."')";
		 mysqli_query($link,$sql_in);
		 echo"<script>alert('添加成功');window.location.href='video_manager.php';</script>";
		 
		 }

?>